3.168 \(\int \frac{1+x+x^2+x^3}{1+x^4} \, dx\)

Optimal. Leaf size=53 \[ \frac{1}{4} \log \left (x^4+1\right )+\frac{1}{2} \tan ^{-1}\left (x^2\right )-\frac{\tan ^{-1}\left (1-\sqrt{2} x\right )}{\sqrt{2}}+\frac{\tan ^{-1}\left (\sqrt{2} x+1\right )}{\sqrt{2}} \]

[Out]

ArcTan[x^2]/2 - ArcTan[1 - Sqrt[2]*x]/Sqrt[2] + ArcTan[1 + Sqrt[2]*x]/Sqrt[2] +
Log[1 + x^4]/4

_______________________________________________________________________________________

Rubi [A]  time = 0.111879, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 8, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.471 \[ \frac{1}{4} \log \left (x^4+1\right )+\frac{1}{2} \tan ^{-1}\left (x^2\right )-\frac{\tan ^{-1}\left (1-\sqrt{2} x\right )}{\sqrt{2}}+\frac{\tan ^{-1}\left (\sqrt{2} x+1\right )}{\sqrt{2}} \]

Antiderivative was successfully verified.

[In]  Int[(1 + x + x^2 + x^3)/(1 + x^4),x]

[Out]

ArcTan[x^2]/2 - ArcTan[1 - Sqrt[2]*x]/Sqrt[2] + ArcTan[1 + Sqrt[2]*x]/Sqrt[2] +
Log[1 + x^4]/4

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 16.6124, size = 48, normalized size = 0.91 \[ \frac{\log{\left (x^{4} + 1 \right )}}{4} + \frac{\operatorname{atan}{\left (x^{2} \right )}}{2} + \frac{\sqrt{2} \operatorname{atan}{\left (\sqrt{2} x - 1 \right )}}{2} + \frac{\sqrt{2} \operatorname{atan}{\left (\sqrt{2} x + 1 \right )}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((x**3+x**2+x+1)/(x**4+1),x)

[Out]

log(x**4 + 1)/4 + atan(x**2)/2 + sqrt(2)*atan(sqrt(2)*x - 1)/2 + sqrt(2)*atan(sq
rt(2)*x + 1)/2

_______________________________________________________________________________________

Mathematica [A]  time = 0.0642398, size = 50, normalized size = 0.94 \[ \frac{1}{4} \left (\log \left (x^4+1\right )-2 \left (1+\sqrt{2}\right ) \tan ^{-1}\left (1-\sqrt{2} x\right )+2 \left (\sqrt{2}-1\right ) \tan ^{-1}\left (\sqrt{2} x+1\right )\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[(1 + x + x^2 + x^3)/(1 + x^4),x]

[Out]

(-2*(1 + Sqrt[2])*ArcTan[1 - Sqrt[2]*x] + 2*(-1 + Sqrt[2])*ArcTan[1 + Sqrt[2]*x]
 + Log[1 + x^4])/4

_______________________________________________________________________________________

Maple [B]  time = 0.004, size = 102, normalized size = 1.9 \[{\frac{\arctan \left ( 1+x\sqrt{2} \right ) \sqrt{2}}{2}}+{\frac{\arctan \left ( x\sqrt{2}-1 \right ) \sqrt{2}}{2}}+{\frac{\sqrt{2}}{8}\ln \left ({\frac{1+{x}^{2}+x\sqrt{2}}{1+{x}^{2}-x\sqrt{2}}} \right ) }+{\frac{\arctan \left ({x}^{2} \right ) }{2}}+{\frac{\sqrt{2}}{8}\ln \left ({\frac{1+{x}^{2}-x\sqrt{2}}{1+{x}^{2}+x\sqrt{2}}} \right ) }+{\frac{\ln \left ({x}^{4}+1 \right ) }{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((x^3+x^2+x+1)/(x^4+1),x)

[Out]

1/2*arctan(1+x*2^(1/2))*2^(1/2)+1/2*arctan(x*2^(1/2)-1)*2^(1/2)+1/8*2^(1/2)*ln((
1+x^2+x*2^(1/2))/(1+x^2-x*2^(1/2)))+1/2*arctan(x^2)+1/8*2^(1/2)*ln((1+x^2-x*2^(1
/2))/(1+x^2+x*2^(1/2)))+1/4*ln(x^4+1)

_______________________________________________________________________________________

Maxima [A]  time = 1.51933, size = 103, normalized size = 1.94 \[ -\frac{1}{4} \, \sqrt{2}{\left (\sqrt{2} - 2\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + \sqrt{2}\right )}\right ) + \frac{1}{4} \, \sqrt{2}{\left (\sqrt{2} + 2\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x - \sqrt{2}\right )}\right ) + \frac{1}{4} \, \log \left (x^{2} + \sqrt{2} x + 1\right ) + \frac{1}{4} \, \log \left (x^{2} - \sqrt{2} x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^3 + x^2 + x + 1)/(x^4 + 1),x, algorithm="maxima")

[Out]

-1/4*sqrt(2)*(sqrt(2) - 2)*arctan(1/2*sqrt(2)*(2*x + sqrt(2))) + 1/4*sqrt(2)*(sq
rt(2) + 2)*arctan(1/2*sqrt(2)*(2*x - sqrt(2))) + 1/4*log(x^2 + sqrt(2)*x + 1) +
1/4*log(x^2 - sqrt(2)*x + 1)

_______________________________________________________________________________________

Fricas [A]  time = 0.241714, size = 217, normalized size = 4.09 \[ -\sqrt{\frac{1}{2}} \sqrt{\sqrt{2}{\left (3 \, \sqrt{2} - 4\right )}} \arctan \left (\frac{\sqrt{\frac{1}{2}} \sqrt{\sqrt{2}{\left (3 \, \sqrt{2} - 4\right )}}{\left (\sqrt{2} + 1\right )}}{\sqrt{2} x + \sqrt{2} \sqrt{x^{2} + \sqrt{2} x + 1} + 1}\right ) - \sqrt{\frac{1}{2}} \sqrt{\sqrt{2}{\left (3 \, \sqrt{2} + 4\right )}} \arctan \left (\frac{\sqrt{\frac{1}{2}} \sqrt{\sqrt{2}{\left (3 \, \sqrt{2} + 4\right )}}{\left (\sqrt{2} - 1\right )}}{\sqrt{2} x + \sqrt{2} \sqrt{x^{2} - \sqrt{2} x + 1} - 1}\right ) + \frac{1}{4} \, \log \left (x^{2} + \sqrt{2} x + 1\right ) + \frac{1}{4} \, \log \left (x^{2} - \sqrt{2} x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^3 + x^2 + x + 1)/(x^4 + 1),x, algorithm="fricas")

[Out]

-sqrt(1/2)*sqrt(sqrt(2)*(3*sqrt(2) - 4))*arctan(sqrt(1/2)*sqrt(sqrt(2)*(3*sqrt(2
) - 4))*(sqrt(2) + 1)/(sqrt(2)*x + sqrt(2)*sqrt(x^2 + sqrt(2)*x + 1) + 1)) - sqr
t(1/2)*sqrt(sqrt(2)*(3*sqrt(2) + 4))*arctan(sqrt(1/2)*sqrt(sqrt(2)*(3*sqrt(2) +
4))*(sqrt(2) - 1)/(sqrt(2)*x + sqrt(2)*sqrt(x^2 - sqrt(2)*x + 1) - 1)) + 1/4*log
(x^2 + sqrt(2)*x + 1) + 1/4*log(x^2 - sqrt(2)*x + 1)

_______________________________________________________________________________________

Sympy [A]  time = 0.675776, size = 73, normalized size = 1.38 \[ \frac{\log{\left (x^{2} - \sqrt{2} x + 1 \right )}}{4} + \frac{\log{\left (x^{2} + \sqrt{2} x + 1 \right )}}{4} + 2 \left (\frac{1}{4} + \frac{\sqrt{2}}{4}\right ) \operatorname{atan}{\left (\sqrt{2} x - 1 \right )} + 2 \left (- \frac{1}{4} + \frac{\sqrt{2}}{4}\right ) \operatorname{atan}{\left (\sqrt{2} x + 1 \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x**3+x**2+x+1)/(x**4+1),x)

[Out]

log(x**2 - sqrt(2)*x + 1)/4 + log(x**2 + sqrt(2)*x + 1)/4 + 2*(1/4 + sqrt(2)/4)*
atan(sqrt(2)*x - 1) + 2*(-1/4 + sqrt(2)/4)*atan(sqrt(2)*x + 1)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.211986, size = 95, normalized size = 1.79 \[ \frac{1}{2} \,{\left (\sqrt{2} - 1\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x + \sqrt{2}\right )}\right ) + \frac{1}{2} \,{\left (\sqrt{2} + 1\right )} \arctan \left (\frac{1}{2} \, \sqrt{2}{\left (2 \, x - \sqrt{2}\right )}\right ) + \frac{1}{4} \,{\rm ln}\left (x^{2} + \sqrt{2} x + 1\right ) + \frac{1}{4} \,{\rm ln}\left (x^{2} - \sqrt{2} x + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((x^3 + x^2 + x + 1)/(x^4 + 1),x, algorithm="giac")

[Out]

1/2*(sqrt(2) - 1)*arctan(1/2*sqrt(2)*(2*x + sqrt(2))) + 1/2*(sqrt(2) + 1)*arctan
(1/2*sqrt(2)*(2*x - sqrt(2))) + 1/4*ln(x^2 + sqrt(2)*x + 1) + 1/4*ln(x^2 - sqrt(
2)*x + 1)